class Solution {
    public static int[] twoSum(int[] nums, int target) {
        int[] arr = new int[2];
        int n = nums.length;
        if (n <= 1) return arr;
        for (int i = 0; i < n; i++) {
            for (int j = i + 1; j < n; j++) {
                if (nums[i] + nums[j] == target) {
                    arr[0] = i;
                    arr[1] = j;
                    return arr;
                }
            }
        }
        return arr;
    }

    public static void main(String[] args) {
        int[] arr ={2,7,11,15};
        int target = 9;
        System.out.println(twoSum(arr, target));
    }
}